#ifndef SOUND_PIPELINE_H
#define SOUND_PIPELINE_H

#define mute(a) sound_pipeline::self()->_mute(a)

#define set_music_volume(a) sound_pipeline::self()->_set_music_volume(a)
#define set_sound_volume(a) sound_pipeline::self()->_set_sound_volume(a)
#define get_music_volume() sound_pipeline::self()->_get_music_volume()
#define get_sound_volume() sound_pipeline::self()->_get_sound_volume()

#define playM(a) sound_pipeline::self()->_playM(a)

#define playS(a,b,c,d) sound_pipeline::self()->_playS( a,b,c,d)

#define MUSIC_0	0
#define MUSIC_1	1
#define MUSIC_2	2
#define MUSIC_3	3
#define MUSIC_4	4
#define MUSIC_5	5
#define MUSIC_6 6
#define MUSIC_7	7

#define MUSIC_HORSE 10

#define MUSIC_LEN 20

#define SOUND_CRASH 0

#define SOUND_LEN 20

#include <cmath>
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#include "common.h"

class sound_pipeline{
	private:
		sound_pipeline();
		Mix_Chunk * sound[SOUND_LEN];
		Mix_Music * music[MUSIC_LEN];
		int ifmute;
		float music_volume,sound_volume;
		
		int current_music;
	public:
		static sound_pipeline * self();
			
		void _mute(int);

		void _set_music_volume(float);
		void _set_sound_volume(float);
		float _get_music_volume(){return music_volume;}
		float _get_sound_volume(){return sound_volume;}

		void _playM(int);

		void _playS(int,float, float, float);

};

#endif
